package com.itheima.neibulei.demo07;
/*
匿名内部类的使用 场景

现有一个接口
有一个方法 要使用这个接口

调用该方法;
 */
public class Demo {
    public static void main(String[] args) {
       /* SwimmingImpl swimming = new SwimmingImpl();
        useSwimming(swimming);*/
       useSwimming(new Swimming() {
           @Override
           public void swim() {
               System.out.println("走,看美腿走");
           }
       });
    }
    public static  void useSwimming(Swimming swim){
        swim.swim();
    }
}
interface  Swimming{
    void swim();
}

/*
class SwimmingImpl implements Swimming{

    @Override
    public void swim() {
        System.out.println("走,游泳走");
    }
}*/
